package xuanzhen.reservation.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import xuanzhen.reservation.dao.PostManMapper;
import xuanzhen.reservation.pojo.PostMan;
import xuanzhen.reservation.service.PostManService;
@Service
public class PostManServiceImpl implements PostManService {
	@Resource
	PostManMapper postManMapper;
	@Override
	public int insertPostMan(PostMan postMan) throws Exception {
		postManMapper.insertPostMan(postMan);
		List<PostMan> posList = postManMapper.selectListByEntity(postMan);
		if (posList.isEmpty()) {
			return 0;
		}else {
			return 1;
		}
	}

	@Override
	public int updatePostMan(PostMan postMan) throws Exception {
		postManMapper.updatePostMan(postMan);
		List<PostMan> posList = postManMapper.selectListByEntity(postMan);
		if (posList.isEmpty()) {
			return 0;
		}else {
			return 1;
		}
	}

	@Override
	public List<PostMan> queryListByEntity(PostMan postMan) throws Exception {
		List<PostMan> posList = postManMapper.selectListByEntity(postMan);
		return posList;
	}

	@Override
	public List<PostMan> queryListByMap(Map<String, Object> parameter) throws Exception {
		List<PostMan> posList = postManMapper.selectListByMap(parameter);
		return posList;
	}

	@Override
	public List<PostMan> selectpostListByMap(Map<String, Object> parameter) throws Exception {
		// TODO Auto-generated method stub
		return postManMapper.selectpostListByMap(parameter);
	}

}
